<?php
/*供ajax使用*/
header("Content-type:text/html; charset=utf-8");
require_once ('config.php');
require_once (WEBURL.'/include/conn.php');
require_once (WEBURL.'/login_status_check.php');
if(!checkLogin()){
	require_once ('admin_login.php');
}

if(!isset($_GET['channel_id'])){
	return;
}
$channel_id=$_GET['channel_id'];
/*获取该父栏目的channel_grade*/
$sql_get_pre_path="select channel_grade,is_bottom from channel where channel_id=$channel_id";
$result_get_pre_path=mysql_query($sql_get_pre_path);
if(!$result_get_pre_path){
	return;
}
$row_get_pre_path=mysql_fetch_object($result_get_pre_path);
$channel_grade= $row_get_pre_path->channel_grade;
$is_bottom=$row_get_pre_path->is_bottom;
/*查询该父栏目是否已含有文章*/
$channel_has_article=0;
if($is_bottom==1){
$sql_check_channel_has_articles="select * from article_normal where article_main_channel=$channel_id";
$result_check_channel_has_articles=mysql_query($sql_check_channel_has_articles);
if(!$result_check_channel_has_articles){
	return;
}
$num=mysql_num_rows($result_check_channel_has_articles);
if($num!=0){
	$channel_has_article=1;
}
}
echo $channel_grade.",".$channel_has_article;